<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:form id="formACota">
	<p:outputPanel id="cotas" style="width:800px;">
		<p:dataGrid id="cotaCa" var="cota"
			value="#{listaOrcamentoTela.listaCotacoes}" columns="2" rows="6"
			paginator="true"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="6,9,15" emptyMessage="#{message.table_empty}">
			<p:panel header="#{cota.fornecedor.nome}"
				style="text-align:center;width: 350px;">

				<h:panelGrid columns="2" style="text-align:right; width:100%;"
					styleClass="teste">
					<h:outputText style="font-weight: bold;"
						value="#{message.label_marca}:" />
					<p:inputText value="#{cota.marca}" size="25"
						readonly="true" />
					<h:outputText style="font-weight: bold;"
						value="#{message.label_valor_uni}:" />
					<p:inputText value="#{cota.valorUnitario}" size="25"
						readonly="true" />
					<h:outputText style="font-weight: bold;"
						value="#{message.label_prazo}:" />
					<p:inputText value="#{cota.prazoEntrega}" size="25" readonly="true" />
					<h:outputText style="font-weight: bold;"
						value="#{message.label_frete}:" />
					<p:inputText value="#{cota.tipoFrete}" size="25" readonly="true" />

					<h:outputText style="font-weight: bold;"
						value="#{message.label_forma_pag}:" />
					<p:inputText value="#{cota.formaPagamento.metodoPag}" size="25"
						readonly="true" />
					<h:outputText style="font-weight: bold;" value="" />
					<p:inputText value="#{cota.formaPagamento.formaPag}" size="25"
						readonly="true" />

					<h:outputText style="font-weight: bold;"
						value="#{message.label_observacao}:" />
					<p:inputTextarea rows="6" cols="25" style="margin-top:15px;"
						value="#{cota.observacao}" readonly="true" />

				</h:panelGrid>

				<br />
				<br />
				<p:commandButton
					actionListener="#{cotacaoTela.preparaImagem(cota.imagemProd)}"
					onclick="visuProd.show()" update=":visualizaProd"
					icon="ui-icon-image" value="#{message.tooltip_ver_prod}"
					rendered="#{cota.imagemProd != null ? true : false}">
				</p:commandButton>
				<br />
				<br />
				<p:commandButton icon="ui-icon-check"
					value="#{message.botao_aprovar}"
					oncomplete="confirmaAprovacao.show()">
					<f:setPropertyActionListener value="#{cota}"
						target="#{listaOrcamentoTela.cotacao}" />
				</p:commandButton>
			</p:panel>

		</p:dataGrid>

	</p:outputPanel>

</h:form>

<p:confirmDialog widgetVar="confirmaAprovacao" severity="warning"
	appendToBody="true" message="#{message.msg_body_conf_cota}">
	<h:form prependId="false">
		<p:commandButton icon="ui-icon-check" value="#{message.label_sim}"
			action="#{listaOrcamentoTela.aprovaCotacao}"
			oncomplete="confirmaAprovacao.hide();dlgAprovaCota.hide();"
			update=":formACota:cotaCa,:formLOrca:orcas,:messages" />
		<p:commandButton icon="ui-icon-close" value="#{message.label_nao}"
			onclick="confirmaAprovacao.hide()" type="button" />
	</h:form>

</p:confirmDialog>

</html>